<head>
<link rel="stylesheet" type="text/css" href="../css/style.css" >
<style>
td{font-size:10px;padding:1px;color:#000000;background-color:transparent !important;}
</style>
</head>
<p class="subhead">
Encode|Decode
</p>
<!--
<table width=100%>
<form method="POST" action="url2encode.php" >
<tr>
<td align=left >需要解密的字符串: <input type="text" name="ept" style="width:100%;" /></td>
</tr>
<tr>
<td align=left >需要加密的字符串: <input type="text" name="dpt" style="width:100%;" /></td>
<td align=center rowspan=2 ><input style="width:100px;height:30px;background-color:lightblue;font-weight:bold" type="submit" value="Convert" /></td>
</tr>
</table>
</form>
-->

<form method="POST" action="url2encode.php" >
<?PHP
    if(isset($_POST['type']) && $_POST['type'] == 'de')
    {
        echo '<input type=radio name="type" value="en" />加密';
        echo '<input type=radio name="type" checked=checked value="de" />解密';
    }
    else
    {
        echo '<input type=radio name="type" checked=checked value="en" />加密';
        echo '<input type=radio name="type" value="de" />解密';
    }
?>
    <tr>
    <td width=90% ><input type="text" name="instr" style="width:70%;" />
    <td width=10% ><input style="width:100px;height:30px;background-color:lightblue;font-weight:bold" type="submit" value="Convert" /></td>
    </tr>
</form>

<div style="width:100%;height:120px;background-color:#E6E6FA" >
<?PHP
if(isset($_POST['type']) && $_POST['type'] == 'de' )
{
        echo '<p><font size=4 style="font-weight:blod;" color=#800000>解密结果:</font><br /><font color=black >'.urldecode($_POST['instr']).'</font></p>';
}
elseif(isset($_POST['type']) && $_POST['type'] == 'en' )
{
        echo '<p><font size=4 style="font-weight:blod;" color=#800000>加密结果:</font><br /><font color=black >'.urlencode($_POST['instr']).'</font></p>';
}

?>
</div>

